package com.sign.fragment;

import com.sign.signsystem.R;
import com.sign.signsystem.UserDetailActivity;
import com.sign.signsystem.UserSecurityActivity;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.View.OnClickListener;
import android.view.ViewGroup;
import android.widget.LinearLayout;

public class UserFragment extends Fragment implements OnClickListener {
	LinearLayout user_information_layout, user_password_layout;

	public static UserFragment newInstance() {
		UserFragment fragment = new UserFragment();
		return fragment;
	}

	public UserFragment() {
	}

	@Override
	public View onCreateView(LayoutInflater inflater, ViewGroup container,
			Bundle savedInstanceState) {
		View rootView = inflater.inflate(R.layout.user_fragment, container,
				false);
		user_information_layout = (LinearLayout) rootView.findViewById(R.id.user_information_Layout);
		user_password_layout = (LinearLayout) rootView.findViewById(R.id.user_password_Layout);
		user_information_layout.setOnClickListener(this);
		user_password_layout.setOnClickListener(this);
		return rootView;

	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see android.view.View.OnClickListener#onClick(android.view.View)
	 */
	@Override
	public void onClick(View v) {
		switch (v.getId()) {
		case R.id.user_information_Layout: {
			Intent intent = new Intent(v.getContext(), UserDetailActivity.class);
			startActivity(intent);
			break;
		}
		case R.id.user_password_Layout: {
			Intent intent = new Intent(v.getContext(),
					UserSecurityActivity.class);
			startActivity(intent);
			break;
		}
		default:

			break;
		}
	}

}
